import request from '@/request'
import { C2B } from '@/utils/wordtransfer.js'

// 查询搜索并分页
export const findPages = (data) => {
    return request.post('/course/order/list', data)
}

// id查询明细
export const getById = (id) => {
    return request.post(`/course/order/get/${id}`, {})
}

// 批量彻底删除
export const batchRemoves = (ids) => {
    return request.post('/course/order/batch/remove', { ids })
}

// 物理删除
export const removeById = (id) => {
    return request.post(`/course/order/remove/${id}`, {})
}

// 修改状态
export const updateStatus = (id, field, value) => {
    field = C2B(field)
    return request.post(`/course/order/status/${id}/${field}?value=${value}`, {})
}

// 给用户绑定订单
export const bindUserOrder = (uuid,opid) => {
    return request.post(`/course/order/userbind?opid=${opid}&uuid=${uuid}`, {})
}
